package cn.tedu.shoot;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
/**图片工具类*/
public class Images {//BufferedImage 装图片的类
	public static BufferedImage background;
	public static BufferedImage bullet;
	public static BufferedImage bulletx;
	public static BufferedImage[] laserx;
	public static BufferedImage[] heros;
	public static BufferedImage[] airplanes;
	public static BufferedImage[] bigairplanes;
	public static BufferedImage[] bees;
	public static BufferedImage start;
	public static BufferedImage pause;
	public static BufferedImage gameover;
	public static BufferedImage[] angerslots;
	public static BufferedImage[] boss;
	public static BufferedImage bossbullet;
	
	
	static {
		boss=new BufferedImage[5];
		boss[0]=readImage("boss1.png");
		bossbullet=readImage("boon.png");
		background = readImage("bg.jpg");
		bullet = readImage("bullet.png");
		bulletx = readImage("bullet-x.png");
		laserx = new BufferedImage[3];
		laserx[0] = readImage("e-blade0.png");
		laserx[1] = readImage("e-blade1.png");
		laserx[2] = readImage("e-blade2.png");
		start = readImage("poo2.png");
		pause = readImage("poo1.png");
		gameover = readImage("poo3.png");
		heros = new BufferedImage[2];	
		heros[0] = readImage("hero.png");
		heros[1] = readImage("hero.png");		
		airplanes = new BufferedImage[5];
		airplanes[0] = readImage("enemy3.png");	
		bigairplanes = new BufferedImage[5];
		bigairplanes[0] = readImage("enemy4.png");	
		bees = new BufferedImage[5];
		bees[0] = readImage("enemy1.png");
		angerslots = new BufferedImage[4];
		angerslots[0] = readImage("angerslot0.png");
		angerslots[1] = readImage("angerslot1.png");
		angerslots[2] = readImage("angerslot2.png");
		angerslots[3] = readImage("angerslot3.png");
		for(int i=1;i<bees.length;i++) {
			airplanes[i] = readImage("enemy3"+i+".png");
			bigairplanes[i] = readImage("enemy4"+i+".png");
			bees[i] = readImage("enemy1"+i+".png");	
			boss[i]=readImage("bom"+i+".png");
		}	
	}
	
	public static BufferedImage readImage(String fileName) {//读取图片： 负责读取图片，不负责传递图片信息；
		try{
			BufferedImage img = ImageIO.read(FlyingObject.class.getResource(fileName));//同包下读取图片
			return img;
		}catch(Exception e){
			e.printStackTrace();
			throw new RuntimeException();
		}
	}

}
